handle no-window and regular widgets seperately.
authorKristian Rietveld <kris@imendio.com>
Thu, 19 Jul 2007 15:03:18 +0000 (15:03 +0000)
committerKristian Rietveld <kristian@src.gnome.org>
Thu, 19 Jul 2007 15:03:18 +0000 (15:03 +0000)
2007-07-19  Kristian Rietveld  <kris@imendio.com>

* gtk/gtktooltip.c (find_topmost_widget_coords_from_event): handle
no-window and regular widgets seperately.

* gtk/gtktreeview.c (gkt_tree_view_set_tooltip_cell): rect.x should
be zero.

svn path=/trunk/; revision=18502

ChangeLog
gtk/gtktooltip.c
gtk/gtktreeview.c

index f5bdd10ce5e7bf677c79d254da5a2d1b0ca39842..c61fde3122585422fb3e003a940e8945d60eeea5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-07-19  Kristian Rietveld  <kris@imendio.com>
+
+       * gtk/gtktooltip.c (find_topmost_widget_coords_from_event): handle
+       no-window and regular widgets seperately.
+
+       * gtk/gtktreeview.c (gkt_tree_view_set_tooltip_cell): rect.x should
+       be zero.
+
 2007-07-19  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtk.symbols:
index c6062053ae23f9d55fd27a1f29c06f52addda2a1..a79617034c5cb610f464733805b2e7a9c26b2e38 100644 (file)
@@ -593,12 +593,25 @@ find_topmost_widget_coords_from_event (GdkEvent *event,
 
   tmp = find_widget_under_pointer (event->any.window, &tx, &ty);
 
-  /* Make sure the pointer can actually be on the widget returned */
-  if (!tmp ||
-      tx < 0 || tx >= tmp->allocation.width ||
-      ty < 0 || ty >= tmp->allocation.height)
+  if (!tmp)
     return NULL;
 
+  /* Make sure the pointer can actually be on the widget returned */
+  if (GTK_WIDGET_NO_WINDOW (tmp))
+    {
+      if (tx < tmp->allocation.x ||
+         tx >= tmp->allocation.x + tmp->allocation.width ||
+         ty < tmp->allocation.y ||
+         ty >= tmp->allocation.y + tmp->allocation.height)
+       return NULL;
+    }
+  else
+    {
+      if (tx < 0 || tx >= tmp->allocation.width ||
+         ty < 0 || ty >= tmp->allocation.height)
+       return NULL;
+    }
+
   if (x)
     *x = tx;
   if (y)
index ad0e2a949cce307bbc8bfca6a2abec3e76583eb2..42fa6f25ce104b5f0c913191bdc2efb767563778 100644 (file)
@@ -15274,7 +15274,7 @@ gtk_tree_view_set_tooltip_cell (GtkTreeView       *tree_view,
     }
   else
     {
-      rect.x = GTK_WIDGET (tree_view)->allocation.x;
+      rect.x = 0;
       rect.width = GTK_WIDGET (tree_view)->allocation.width;
     }